-- --------------------------------
-- dZt - ƾڮw榡
-- (sΤA)
-- --------------------------------

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

-- 
-- Database: `aitle_detention`
-- 

-- --------------------------------------------------------

CREATE DATABASE `aitle_detention`;
USE `aitle_detention`;

-- 
-- Table structure for table `detention_attendance`
-- 

DROP TABLE IF EXISTS `detention_attendance`;
CREATE TABLE `detention_attendance` (
  `d_id` int(11) NOT NULL,
  `d_date` date NOT NULL default '0000-00-00',
  `d_attcode` tinyint(2) default NULL,
  `d_updatedby` varchar(5) default NULL,
  PRIMARY KEY  (`d_id`,`d_date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

-- 
-- Table structure for table `detention_outstanding`
-- 

DROP TABLE IF EXISTS `detention_outstanding`;
CREATE TABLE `detention_outstanding` (
  `d_id` int(11) NOT NULL,
  `d_numdays` smallint(6) NOT NULL,
  PRIMARY KEY  (`d_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

-- 
-- Table structure for table `detention_record`
-- 

DROP TABLE IF EXISTS `detention_record`;
CREATE TABLE `detention_record` (
  `d_id` int(10) unsigned NOT NULL auto_increment,
  `sid` varchar(15) NOT NULL,
  `tid` varchar(10) NOT NULL,
  `tid2` varchar(10) default NULL,
  `d_reason` varchar(50) NOT NULL,
  `d_action` varchar(50) NOT NULL,
  `d_numdays` smallint(6) NOT NULL default '0',
  `timestamp` datetime NOT NULL,
  PRIMARY KEY  (`d_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

-- 
-- Table structure for table `detention_student`
-- 

DROP TABLE IF EXISTS `detention_student`;
CREATE TABLE `detention_student` (
  `sid` varchar(10) NOT NULL,
  `cls` varchar(3) NOT NULL,
  `cno` smallint(2) NOT NULL,
  `cname` varchar(10) NOT NULL,
  `ename` varchar(50) NOT NULL,
  PRIMARY KEY  (`sid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

-- 
-- Table structure for table `detention_user`
-- 

DROP TABLE IF EXISTS `detention_user`;
CREATE TABLE `detention_user` (
  `user` varchar(50) NOT NULL,
  `pw` varchar(50) default NULL,
  `name` varchar(50) NOT NULL,
  `post` varchar(50) default NULL,
  `d_rights` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

